var PhoneCheck = new 
function () {

    var divisionCode, mobilePhone, formatPhone, phoneSection, phoneCode, phoneExt, phoneTips, mobileTips;

    var i = function () {
        var G = {};
        G = formatPhone.val().split("-");
        phoneSection.val(G[0]);
        phoneCode.val(G[1]);
      
            phoneExt.val(G[2]);
        
        
    };
    this.attachPhoneCheck = function () {
        if (!d()) {
            c(true);
            return false
        }

        formatPhone.val(u());
        return true
    };
    var u = function () {
        var G = "";
        G = phoneSection.val() + "-" + phoneCode.val() + "-" + phoneExt.val();

        return G
    };
    var d = function () {
        t();

        var L = y(divisionCode);
        var mobile = y(mobilePhone);
        var Section = y(phoneSection);
        var pCode = y(phoneCode);
        var Ext = y(phoneExt);
        var J = Section + "-" + pCode + "-" + Ext;
        var N = Section + pCode + Ext;
        var M = 710000;
        if (L > M) {
            return f(mobile, N)
        } else {
            return v(mobile, N, J)
        }
        return true
    };
    var t = function () {
        var G = "(\u533a\u53f7-\u7535\u8bdd\u53f7\u7801-\u5206\u673a)";
        if (phoneTips) {
            phoneTips.innerHTML = G
        }
        var H = "";
        if (mobileTips) {
            mobileTips.innerHTML = H
        }
    };
    var y = function (G) {

        if (typeof ($(G).val()) == "undefined") {
            return "";
        }
        if (G && G.val()) {
            G.val($.trim(G.val()));
        }
        return G.val();
    };
    var s = function (H) {
        var G = /^\d{9,16}$/;
        return G.test(H)
    };
    var k = function (G) {
        var H = /^\d{3,6}-\d{5,10}-\d{0,6}$/;
        return H.test(G)
    };
    var o = function (I) {
        var G = false;
        try {
            G = isNaN(Math.abs(I))
        } catch (H) { }
        return G
    };
    var p = function (H) {
        var G = false;
        try {
            G = isNaN(Math.abs(H))
        } catch (I) { }
        return G
    };
    var f = function (H, G) {
        if (H.length > 0 || G.length > 0) {
            if (G.length > 0 && p(G)) {
                a();
                return false
            }
            if (H.length > 0 && o(H)) {
                C();
                return false
            }
            return true
        } else {
            e();
            return false
        }
    };
    var v = function (I, H, G) {

        if (I.length > 0 || H.length > 0) {
            if (H.length > 0 && !k(G)) {
                q();
                return false
            }
            if (I.length > 0 && !s(I)) {
                j();
                return false
            }
            return true
        } else {
            F();
            return false
        }
    };
    var c = function (G) {
        var H = $("#_edit_address");
        if (H == null) {
            return
        }
        if (!G) {
            H.hide();
        } else {
            H.show();
        }
    };
    var F = function () {
        c(true);
        alert("\u8bf7\u8f93\u5165\u7535\u8bdd\u53f7\u7801\u6216\u624b\u673a\u53f7\u7801.");
        var H = '<font color="red">\u8bf7\u8f93\u5165\u7535\u8bdd\u53f7\u7801\u6216\u624b\u673a\u53f7\u7801.</font>';
        var G = $("#phoneTips");
        if (G) {
            G.innerHTML = H
        }
        if (phoneSection) {
            phoneSection.focus()
        }
    };
    var q = function () {
        c(true);
        alert("\u7535\u8bdd\u53f7\u7801\u7684\u683c\u5f0f\u5fc5\u987b\u8f93\u5165\u6b63\u786e.");
        var G = '<font color="red">\u683c\u5f0f\u5fc5\u987b\u6b63\u786e\uff0c\u5982: 0571-43868529</font>';
        if (phoneTips) {
            phoneTips.innerHTML = G
        }
        if (phoneExt) {
            phoneExt.focus()
        }
    };
    var j = function () {
        c(true);
        alert("\u624b\u673a\u53f7\u7801\u7684\u683c\u5f0f\u5fc5\u987b\u6b63\u786e.");
        var G = '<font color="red">\u683c\u5f0f\u5fc5\u987b\u6b63\u786e,\u5982: 13412345678</font>';
        if (mobileTips) {
            mobileTips.innerHTML = G
        }
        if (mobilePhone) {
            mobilePhone.focus()
        }
    };
    var a = function () {
        c(true);
        alert("\u96fb\u8a71\u865f\u78bc\u7684\u683c\u5f0f\u5fc5\u9808\u8f38\u5165\u6b63\u78ba.");
        var G = '<font color="red">\u96fb\u8a71\u865f\u78bc\u7684\u683c\u5f0f\u5fc5\u9808\u8f38\u5165\u6b63\u78ba.</font>';
        if (phoneTips) {
            phoneTips.innerHTML = G
        }
        if (phoneExt) {
            phoneExt.focus()
        }
    };
    var C = function () {
        c(true);
        alert("\u624b\u6a5f\u865f\u78bc\u7684\u683c\u5f0f\u5fc5\u9808\u6b63\u78ba.");
        var G = '<font color="red">\u624b\u6a5f\u865f\u78bc\u7684\u683c\u5f0f\u5fc5\u9808\u6b63\u78ba.</font>';
        if (mobileTips) {
            mobileTips.innerHTML = G
        }
        if (mobilePhone) {
            mobilePhone.focus()
        }
    };
    var e = function () {
        c(true);
        alert("\u8acb\u8f38\u5165\u96fb\u8a71\u865f\u78bc\u6216\u624b\u6a5f\u865f\u78bc.");
        var G = '<font color="red">\u8acb\u8f38\u5165\u96fb\u8a71\u865f\u78bc\u6216\u624b\u6a5f\u865f\u78bc.</font>';
        if (phoneTips) {
            phoneTips.innerHTML = G
        }
        if (phoneSection) {
            phoneSection.focus()
        }
    };

    this.easyInit = function () {
        divisionCode = $("#divisionCode");
        mobilePhone = $("#mobilePhone");
        formatPhone = $("#formatPhone");
        phoneSection = $("#phoneSection");
        phoneCode = $("#phoneCode");
        phoneExt = $("#phoneExt");
        phoneTips = $("#phoneTips");
        mobileTips = $("#mobileTips")
    };
    this.initFixedPhone = function (G) {
        phoneSection = $("#phoneSection");
        phoneCode = $("#phoneCode");
        phoneExt = $("#phoneExt");
        formatPhone = G;
        i()
    };
};